
	
function saveFormDefinition(){
	var formName =$("#formName").val();
	var formId =$("#formId").val();
	var sHtml=editor.html();
	if($.trim(formName)=='null' || $.trim(formName)==''){
		alert("名称不能为空！");
		return;
	}
	if($.trim(formId)=='null' || $.trim(formId)==''){
		alert("请选择关联内容！");
		return;
	}
	if($.trim(sHtml)==''||$.trim(sHtml)=='null'){
		alert("请生成表单！");
		return;
	}
	$("#content").val($.trim(sHtml));
	$.post("saveFormDefinition.action",$("form").serialize(),function(data){
			if(data=='success'){
				alert("操作成功！");
				window.close();
				window.opener.location.href="formDefinitionList.action";
			}else{
				alert("操作失败！");
			}
		});	
}	

	
function updateFormDefinition(){
	var formName =$("#formName").val();
	var formId =$("#formId").val();
		var sHtml=editor.html();
	if($.trim(formName)=='null' || $.trim(formName)==''){
		alert("名称不能为空！");
		return;
	}
	if($.trim(formId)=='null' || $.trim(formId)==''){
		alert("请选择关联内容！");
		return;
	}
	if($.trim(sHtml)==''||$.trim(sHtml)=='null'){
		alert("请生成表单！");
		return;
	}
	$("#content").val($.trim(sHtml));
	$.post("updateFormDefinition.action",$("form").serialize(),function(data){
			if(data=='success'){
				alert("操作成功！");
				window.close();
				var currentPage=$("#currentPage").val();
				window.opener.page(currentPage);
			}else{
				alert("操作失败！");
			}
		});	
}	


function showStyleForm(val){
	var formId=$("#formId").val();
	if(val==''){
		val=0;
	}
	if(formId==''){
		alert("请选择关联内容！");
		val='';
		return;
	}else{
		var param={"formId":formId,"colspan":val};
		$.post("showFormStyle.action",param,function(data){
			editor.html(data);
		});
	}
}